Repository navigation
feat(blueprints): add Blueprint-specific service settings - #2965
Conversation
|
View your CI Pipeline Execution ↗ for commit 4c43b0d
💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗ ☁️ Nx Cloud last updated this comment at |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## staging #2965 +/- ##
==========================================
Coverage ? 50.34%
==========================================
Files ? 1352
Lines ? 29343
Branches ? 8654
==========================================
Hits ? 14772
Misses ? 12145
Partials ? 2426
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
410a004 to
4f5eeb0
Compare
9c84a73 to
e7c14d8
Compare
|
@cubic-dev Please review this PR |
@rmnbrd I have started the AI code review. It will take a few minutes to complete. |
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved review findings affect routing, Blueprint settings behavior, analytics, metadata, and modal handling.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
Adds Blueprint-specific settings, metadata, and update-preview workflows for Terraform- and Helm-based services.
Changes:
- Adds Blueprint configuration routing, navigation, persistence, validation, and optimistic updates.
- Refines Blueprint metadata and update-preview modal behavior.
- Updates shared modal APIs, generated client dependencies, and tests.
File summaries
| File | Summary and final review notes |
|---|---|
yarn.lock |
Updates generated API client lock data. |
package.json |
Updates the generated API client dependency. |
libs/shared/ui/src/lib/components/modal/use-modal/use-modal.tsx |
Reuses shared modal option types. |
libs/shared/ui/src/lib/components/modal/modal.tsx |
Adds modal dismissal and sizing support. moderate (3 votes): The default '474' width emits width: 474, which is invalid CSS and changes default modal sizing; numeric strings should retain px while CSS expressions pass through. |
libs/shared/ui/src/lib/components/modal/modal-root.tsx |
Exposes expanded modal options. |
libs/domains/services/feature/src/lib/service-variables-tabs/service-variables-utils.ts |
Hides Terraform variables for Blueprint services. |
libs/domains/services/feature/src/lib/service-variables-tabs/service-variables-utils.spec.ts |
Tests Terraform tab visibility. |
libs/domains/services/feature/src/lib/service-overview/service-header/service-header.tsx |
Revises Blueprint header metadata. moderate (2 votes): Omitting the repository from useBlueprintUpdateState causes the pinned version badge to disappear for affected Terraform services when update lookup fails; pass the repository while keeping showRepository={false} or provide another valid local tag. |
libs/domains/services/feature/src/lib/service-overview/service-header/service-header.spec.tsx |
Updates header metadata tests. |
libs/domains/services/feature/src/lib/service-list/service-list-cells/service-version-cell.spec.tsx |
Updates Blueprint status tests. |
libs/domains/services/feature/src/lib/service-blueprint-update-flow/blueprint-update-preview-step.tsx |
Supports page and modal preview layouts. |
libs/domains/services/feature/src/lib/service-blueprint-update-flow/blueprint-update-preview-step.spec.tsx |
Tests modal preview behavior. |
libs/domains/services/feature/src/lib/service-blueprint-update-flow/blueprint-update-flow.tsx |
Exports reusable update-flow components. |
libs/domains/services/feature/src/lib/service-blueprint-update-flow/blueprint-update-flow-shell.tsx |
Supports configurable flow step titles. |
libs/domains/services/feature/src/lib/service-blueprint-update-flow/blueprint-update-badge.tsx |
Clarifies Blueprint status labels. |
libs/domains/services/feature/src/lib/service-blueprint-update-flow/blueprint-update-badge.spec.tsx |
Updates status badge tests. |
libs/domains/services/feature/src/lib/service-blueprint-update-flow/blueprint-metadata.tsx |
Centralizes Blueprint metadata rendering. moderate (3 votes): When versionBadge is empty, the component still renders an unnamed, focusable link; create the link only when versionBadge exists. |
libs/domains/services/feature/src/lib/hooks/use-blueprint-variables/use-blueprint-variables.ts |
Loads persisted Blueprint variables. |
libs/domains/services/feature/src/index.ts |
Exports Blueprint utilities and components. nit (1 vote): Three exports are already present in this barrel; re-exporting them adds no API and makes the index harder to maintain. |
libs/domains/services/data-access/src/lib/domains-services-data-access.ts |
Adds Blueprint variables query access. |
libs/domains/service-settings/feature/src/lib/service-settings-layout/service-settings-layout.tsx |
Adds Blueprint-specific settings navigation. moderate (2 votes): Sidebar restrictions do not protect directly reachable Terraform-specific routes such as terraform-arguments and deployment restrictions; add route-level guards or redirects for unsupported routes. |
libs/domains/service-settings/feature/src/lib/service-settings-layout/service-settings-layout.spec.tsx |
Tests Blueprint settings navigation. |
libs/domains/service-settings/feature/src/lib/service-general-settings/terraform-general-settings/terraform-general-settings.tsx |
Hides unsupported Terraform sections. |
libs/domains/service-settings/feature/src/lib/service-general-settings/terraform-general-settings/terraform-general-settings.spec.tsx |
Tests Terraform Blueprint settings. |
libs/domains/service-settings/feature/src/lib/service-general-settings/service-general-settings.tsx |
Adjusts Blueprint general-settings copy. |
libs/domains/service-settings/feature/src/lib/service-general-settings/helm-general-settings/helm-general-settings.tsx |
Hides unsupported Helm sections. |
libs/domains/service-settings/feature/src/lib/service-general-settings/helm-general-settings/helm-general-settings.spec.tsx |
Tests Helm Blueprint settings. |
libs/domains/service-settings/feature/src/lib/service-general-settings/blueprint-general-settings/blueprint-general-settings.tsx |
Implements Blueprint configuration settings and preview flow. moderate (1 vote): Successful updates do not emit blueprint_settings_updated; capture it only after update and deploy succeed.moderate (1 vote): The promised blueprint_settings_visited event is not captured when the page is displayed.moderate (2 votes): Validation only checks required fields, allowing invalid optional fields to reach Preview; include optional fields while retaining the existing-secret exception. moderate (1 vote): Helm Blueprint catalog repository metadata is omitted; support service.source.git.git_repository as existing overview extraction does.moderate (1 vote): contextVariable fields are omitted, so existing context overrides cannot be viewed or edited.moderate (1 vote): Catalog manifest failures render as an empty valid configuration instead of an error or retry state. moderate (1 vote): The root modal remains mounted after route unmount, leaving the preview over the new route with stale callbacks. moderate (2 votes): Neither promised PostHog event is captured in this settings flow; add the visit event and emit the updated event only after both mutations succeed. moderate (1 vote): A deploy-only failure rolls back persisted configuration from the optimistic cache; roll back only when the update mutation fails. nit (1 vote): min(50vw, 900px) can make the modal unusably narrow on small viewports; use a viewport-safe width such as min(900px, calc(100vw - 32px)). |
libs/domains/service-settings/feature/src/lib/service-general-settings/blueprint-general-settings/blueprint-general-settings.spec.tsx |
Tests Blueprint configuration behavior. |
libs/domains/service-settings/feature/src/index.ts |
Exports Blueprint settings. |
apps/console/src/routeTree.gen.ts |
Registers the generated Blueprint configuration route. |
apps/console/src/routes/_authenticated/organization/$organizationId/project/$projectId/environment/$environmentId/service/$serviceId/variables/route.tsx |
Hides Terraform variables navigation. moderate (2 votes): The nested /variables/terraform route still accepts Blueprint Terraform services; guard it with hasTerraformVariablesTab or redirect when false. |
apps/console/src/routes/_authenticated/organization/$organizationId/project/$projectId/environment/$environmentId/service/$serviceId/update/blueprint/route.tsx |
Returns the Blueprint update flow to settings. |
apps/console/src/routes/_authenticated/organization/$organizationId/project/$projectId/environment/$environmentId/service/$serviceId/settings/blueprint-configuration.tsx |
Adds the Blueprint configuration route. moderate (1 vote): Non-Blueprint services render null, leaving a blank settings area; redirect unsupported services to General as other service-specific routes do. |
Review details
Suppressed comments (10)
apps/console/src/routes/_authenticated/organization/$organizationId/project/$projectId/environment/$environmentId/service/$serviceId/settings/blueprint-configuration.tsx:21
- For a non-Blueprint service, this route returns
null, leaving a blank settings content area when the URL is opened directly or from a stale link. The other service-specific settings routes redirect unsupported services to General; this route should do the same instead of rendering nothing.
if (!organization || !service || !isBlueprintService(service)) {
return null
libs/domains/service-settings/feature/src/lib/service-general-settings/blueprint-general-settings/blueprint-general-settings.tsx:304
- The successful update path only shows a toast; it never emits the
blueprint_settings_updatedevent promised in the PR description (and no such event exists elsewhere in the checkout). Capture it after both the update and deploy mutations succeed, so failed operations are not counted.
try {
await updateBlueprint({ blueprintId: service.blueprint_id, payload })
await deployBlueprint({ blueprintId: service.blueprint_id })
toast('success', 'Blueprint update started')
libs/domains/service-settings/feature/src/lib/service-general-settings/blueprint-general-settings/blueprint-general-settings.tsx:163
- The PR description promises a
blueprint_settings_visitedPostHog event, but this new settings page has noposthog.capturecall and the event name does not exist elsewhere in the checkout. Add the visit event when the Blueprint configuration page is displayed so the advertised analytics is actually emitted.
function BlueprintGeneralSettingsContent({ service, environmentId, organizationId }: BlueprintGeneralSettingsProps) {
const { closeModal, openModal } = useModal()
const { data, isLoading } = useBlueprint({ blueprintId: service.blueprint_id })
const { data: persistedVariables = [], isLoading: isVariablesLoading } = useBlueprintVariables({
blueprintId: service.blueprint_id,
libs/domains/service-settings/feature/src/lib/service-general-settings/blueprint-general-settings/blueprint-general-settings.tsx:83
- Blueprint settings drops repository metadata for Helm Blueprint services because this helper only handles Terraform. The existing overview extraction handles Helm Git sources via
service.source.git.git_repository(service-header.tsx:193), so the settings page shows no catalog repository for that supported service type.
function getBlueprintGitRepository(service: BlueprintService) {
return service.serviceType === 'TERRAFORM' ? service.terraform_files_source?.git?.git_repository : undefined
}
libs/domains/service-settings/feature/src/lib/service-general-settings/blueprint-general-settings/blueprint-general-settings.tsx:239
- The settings form only derives
kind === 'variable'fields here. The creation flow also renders overridablecontextVariablefields (blueprint-configuration-view.tsx:207-247), so those fields disappear from this page and Overrides is disabled when a Blueprint has context overrides but no optional variables. Existing Blueprint services with those overrides cannot view or edit them.
const requiredFields = fields.filter(isRequiredVariableField)
const optionalFields = fields.filter(isOptionalVariableField)
libs/domains/service-settings/feature/src/lib/service-general-settings/blueprint-general-settings/blueprint-general-settings.tsx:191
- When the catalog manifest request fails,
dataremains undefined andisLoadingbecomes false, butisErroris ignored andcatalogFieldsdefaults to an empty array. The page then renders an apparently valid empty configuration instead of an error/retry state, and can allow a user to continue without seeing the manifest.
const { data: catalogFields = [], isLoading: isCatalogManifestLoading } = useBlueprintCatalogServiceManifest({
organizationId,
provider,
serviceFamily,
serviceVersion,
libs/domains/service-settings/feature/src/lib/service-general-settings/blueprint-general-settings/blueprint-general-settings.tsx:329
- The preview is stored in the root
ModalProvider, but this component does not close it when the settings route unmounts. Using browser Back or another route change while this non-dismissible modal is open leaves the preview mounted over the new route, with callbacks captured from the old page.
openModal({
content: (
<>
<Dialog.Title className="sr-only">Preview changes</Dialog.Title>
<BlueprintPreview
libs/domains/service-settings/feature/src/lib/service-general-settings/blueprint-general-settings/blueprint-general-settings.tsx:305
- This
catchcovers both mutations. IfupdateBlueprintsucceeds butdeployBlueprintfails, the persisted configuration is rolled back from the optimistic cache, so the page immediately shows stale values even though the update was saved. Roll back only when the update mutation fails and retain the optimistic values for a deploy-only failure.
try {
await updateBlueprint({ blueprintId: service.blueprint_id, payload })
await deployBlueprint({ blueprintId: service.blueprint_id })
toast('success', 'Blueprint update started')
} catch {
libs/domains/service-settings/feature/src/lib/service-general-settings/blueprint-general-settings/blueprint-general-settings.tsx:345
min(50vw, 900px)makes this modal only 160px wide on a 320px viewport, while the content and footer each add 64px of horizontal padding. The preview and action buttons can overflow and become unusable on narrow screens; use a viewport-safe minimum such asmin(900px, calc(100vw - 32px)).
width: 'min(50vw, 900px)',
libs/domains/services/feature/src/index.ts:125
- These three exports are already present in this barrel at lines 34, 43, and 44. Re-exporting them again adds no API and makes the index harder to maintain; keep only the new exports in this block.
export * from './lib/hooks/use-blueprint/use-blueprint'
export * from './lib/hooks/use-deploy-blueprint/use-deploy-blueprint'
export * from './lib/hooks/use-preview-blueprint-update/use-preview-blueprint-update'
export * from './lib/hooks/use-update-blueprint/use-update-blueprint'
- Files reviewed: 33/34 changed files
- Comments generated: 7
- Review effort level: Lite
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
There was a problem hiding this comment.
All reported issues were addressed across 34 files
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
- Capture visits, previews, updates, and update-badge clicks - Add coverage for emitted PostHog events
- Use a numeric default width so the modal renders at 474px - Add regression coverage for the default width
- Disable Preview when optional blueprint variables contain invalid values - Add regression coverage for invalid optional fields
- Remove configurable step title props - Keep the default review and preview labels fixed
- Reuse the service blueprint helper when hiding Terraform source settings
- Share blueprint repository resolution across settings and service header - Pass Helm Git source repositories to blueprint metadata
- Keep Resources available for Terraform blueprints - Update sidebar and blueprint settings coverage
- Roll back optimistic values only when the settings update fails - Preserve persisted values when deployment fails
- Remove the fixed minimum height while preview output is pending - Use merged Tailwind classes and add regression coverage
RemiBonnet
left a comment
There was a problem hiding this comment.
Small comments but otherwise LGTM, well done 👍
|
🎉 This PR is included in version 1.358.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Summary
Issue: QOV-2278
This PR adds Blueprint-specific settings for Blueprint-based services in the Console.
Changes
blueprint_settings_visited;blueprint_settings_updated.Screenshots / Recordings
Testing
yarn testoryarn test -uyarn formatyarn lintPR Checklist
.cursor/rules)